using System.Threading.Tasks;

namespace Beauty.Net.Middleware
{
    public interface ILogStorage
    {
        Task SaveLogAsync(ApiLog log);
    }

    public class ApiLog
    {
        public string RequestId { get; set; } = string.Empty;
        public string Path { get; set; } = string.Empty;
        public string Method { get; set; } = string.Empty;
        public string? RequestBody { get; set; }
        public string? ResponseBody { get; set; }
        public int StatusCode { get; set; }
        public long ResponseTimeMs { get; set; }
        public string? ExceptionMessage { get; set; }
        public string? ExceptionStackTrace { get; set; }
        public System.DateTime Timestamp { get; set; }
    }
}